package com.fyb.doublecache.controller;

import com.fyb.doublecache.entity.Algorithminfo;
import com.fyb.doublecache.service.AlgorithmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：MR.FANG
 * @name：AlgorithmController
 * @Date：2025/7/3 上午10:35
 */

@RestController
@RequestMapping("/api/algorithm")
public class AlgorithmController {

    @Autowired
    private AlgorithmService algorithmService;

    @GetMapping("/{id}")
    public Algorithminfo getAlgorithm(@PathVariable String id) {
        return algorithmService.getAlgorithm(id);
    }

    @PutMapping
    public void updateAlgorithm(@RequestBody Algorithminfo info) {
        algorithmService.updateAlgorithm(info);
    }
}
